<script setup>
import { ref } from 'vue'
import { onLaunch, onShow, onLoad } from '@dcloudio/uni-app'
//引入props
const props = defineProps({
  item: {
    type: Object,
    default: () => ({}),
  },
})
const handleClick = () => {
  // 这里处理点击事件
  console.log('Item clicked:', props.item)
  // 你可以在这里添加跳转逻辑或其他操作
  uni.navigateTo({
    url: `/pages/good/index?id=${props.item.id}`
  })
}
</script>

<template>
  <view @tap="handleClick">
    <image :src="item.picture" mode="scaleToFill" />
    <text>{{ item.name }}</text>
    <text>${{ item.price }}</text>
  </view>
</template>

<style lang="scss"></style>
